import org.apache.spark.SparkConf;
import org.apache.spark.SparkContext;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.function.FlatMapFunction;
import org.apache.spark.rdd.RDD;
import org.codehaus.janino.Java;
import scala.Array;

import java.util.Arrays;
import java.util.Iterator;


/**
 * Created by kaizuidebanli on 2017/7/19.
 */
public class HellowMap {
    public static void main(String [] args){
        SparkConf conf = new SparkConf().setAppName("map").setMaster("local");
        SparkContext sc = new SparkContext(conf);
        JavaRDD lines = sc.textFile("e:/hellowSpark", 1);
        JavaRDD<Integer> lineLengths = lines.map(s -> s.length());
        int totalLength = lineLengths.reduce((a, b) -> a + b);


    }
}
